package repositories;

import java.util.Collection;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import domain.Challenge;

@Repository
public interface ChallengeRepository extends JpaRepository<Challenge, Integer>{

	@Query("select e.challenges from Event e where e.id=?1")
	Collection<Challenge> findChallengesByEvent(int id);
}
